package com.gitee.zhanyao.single.security;

import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtil {

    private SecurityUtil() {
    }

    public static MyUser getCurrentUser() {
        return (MyUser) SecurityContextHolder.getContext()
                .getAuthentication()
                .getPrincipal();
    }

}